package com.lantosec.hmrp.modules.eval.vo;

import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.eval.entity.EvalTask;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 考评任务 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="EvalTask对象", description="考评任务")
public class EvalTaskVO extends BaseVO<EvalTask> {
    private static final long serialVersionUID = 1L;


    public EvalTaskVO(EvalTask entity){
        this.evalTaskId = entity.getEvalTaskId();
        this.evalPlanId = entity.getEvalPlanId();
        this.evalMode = entity.getEvalMode();
        this.startDate = entity.getStartDate();
        this.endDate = entity.getEndDate();
        this.state = entity.getState();
        this.delay = entity.getDelay();
        this.execNum = entity.getExecNum();
        this.targetNum = entity.getTargetNum();
        this.performNum = entity.getPerformNum();
        this.taskTitle = entity.getTaskTitle();
        this.createUser = entity.getCreateUser();
        this.createUserId = entity.getCreateUserId();
        this.createTime = entity.getCreateTime();
    }

    @Override
    public EvalTask convertToEntity(){
        return new EvalTask(this);
    }


    @ApiModelProperty(value = "考评任务ID")
    private Integer evalTaskId;

    @ApiModelProperty(value = "考评计划ID")
    private Integer evalPlanId;

    @ApiModelProperty(value = "考评形式")
    private Integer evalMode;

    @ApiModelProperty(value = "任务开始日期")
    private String startDate;

    @ApiModelProperty(value = "任务结束日期")
    private String endDate;

    @ApiModelProperty(value = "任务标题")
    private String taskTitle;

    @ApiModelProperty(value = "创建人ID")
    private String createUserId;

    @ApiModelProperty(value = "创建人")
    private String createUser;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "计划状态(1暂停2启用3到期4作废)")
    private Integer state;

    @ApiModelProperty(value = "允许延期(工作日)")
    private Integer delay;

    @ApiModelProperty(value = "要求执行次数")
    private Integer execNum;

    @ApiModelProperty(value = "执行对象数")
    private Integer targetNum;

    @ApiModelProperty(value = "执行完成数")
    private Integer performNum;

    @ApiModelProperty(value = "考评对象名称")
    private String name;
    @ApiModelProperty(value = "考评任务所对应的考评项目集合")
    private List<EvalDetailedItemVO> evalTaskDetailedList;
}
